#ifndef _ML_DATA_CLUSTERING_H_
#define _ML_DATA_CLUSTERING_H_
#include <vector>
#include <map>
#include "MLDataSet.h"
#include "MLCommon.h"
#include "MLDistanceFunctions.h"
_MYLABLIB_BEGIN

struct CMLDataCluster
{
	CMLDataSet   dataset;
	CMLDataPoint center;
};

class CMLDataClustering
{
public:
	// Constructor and Destructor
	CMLDataClustering(void);
	virtual ~CMLDataClustering(void);

public:
	// Interfaces
	virtual int SetParameters(const std::wstring& wstrParams) = 0;
	virtual int DoClustering(const CMLDataSet& dataSet, std::vector<CMLDataCluster>& vClusters) = 0;

public:
	// Methods
	inline IMLDataPointDistanceFunc* GetDistanceFunc() { return m_pDistFunc; };
	inline void SetDistanceFunc(IMLDataPointDistanceFunc* pFunc) { m_pDistFunc = pFunc; };

protected:
	// Fields
	IMLDataPointDistanceFunc* m_pDistFunc;
};

class CMLIncrementalDataClustering : public CMLDataClustering
{
public:
	// Constructor and Destructor
	CMLIncrementalDataClustering(void){};
	virtual ~CMLIncrementalDataClustering(void){};

public:
	// Addition Interfaces
	virtual int Insert(const CMLDataPoint& dataPoint) = 0;
	virtual int GetClusters(const std::wstring& params, std::vector<CMLDataCluster>& vClusters) = 0;

public:
	// Methods
	int DoClustering(const CMLDataSet& dataSet, std::vector<CMLDataCluster>& vClusters);
};


_MYLABLIB_END
#endif

